const {Article} = require('../../model/article')
// 分页模块导入
const pagination = require('mongoose-sex-page')
module.exports=async(req,res)=>{
    // res.send('欢迎来到博客首页')
    const page = req.query.page
    let result  = await pagination(Article).page(page).size(4).display(4).find().populate('author').exec()
    let str=JSON.stringify(result);
    let json=JSON.parse(str);
    res.render('home/default.art',{
        result:json
    })
} 